<?php

/**
 * @author Bach Vu (lebachvu@gmail.com)
 * @copyright 2012
 */
	$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
	$IMG_PATH = $DOCUMENT_ROOT . "/files/products/";

	require_once $DOCUMENT_ROOT . '/lib_php/mysqllib.php';
	require_once $DOCUMENT_ROOT . '/lib_php/gfunction.php';  	
 
	#online
	/*	
    $mysql_host = "mysql1.000webhost.com";
    $mysql_database = "a2592666_bxshop";
    $mysql_user = "a2592666_root";
    $mysql_password = "a!@#123";
	*/
	#local
    $mysql_host = "192.168.10.215";
    #$mysql_database = "db_shop";
	#$mysql_database = "relamua_shop";
	$mysql_database = "shopbx";
    $mysql_user = "root";
    $mysql_password = "root";
    
    define ("mysql_host", $mysql_host);
    define ("mysql_database", $mysql_database);
    define ("mysql_user", $mysql_user);
    define ("mysql_password", $mysql_password);      

    #---------------------------------------------------------------------------------------
    #$conn = mysql_connect( mysql_host, mysql_user, mysql_password )  or die(mysql_error());
    #mysql_select_db(mysql_database, $conn) or die(mysql_error());
	#mysql_query("SET character_set_results=utf8", $conn);	// show data VNs
	#---------------------------------------------------------------------------------------
	
	$Config["MySQL"]["DBHost"]=$mysql_host;
    $Config["MySQL"]["DBUser"]=$mysql_user;
    $Config["MySQL"]["DBPass"]=$mysql_password;
    $Config["MySQL"]["DBName"]=$mysql_database;
    
    $DB = new MySQL($Config["MySQL"]["DBHost"], $Config["MySQL"]["DBUser"], $Config["MySQL"]["DBPass"], $Config["MySQL"]["DBName"]);

	### start session
	session_start();
	
    #check session
	#if (isset($_SESSION["Login"]))	echo $_SESSION["Login"]["id"] . $_SESSION["Login"]["group_id"];	
	
	
//  echo "connection ok";
    
/*  

// 	test sql

    $query = "SELECT * FROM `users` WHERE `username`='%s' AND ".
           "`password`='%s'";
           
    $query = sprinf($query, mysql_escape_string($_SERVER['PHP_AUTH_USER']),
                          $saltedPassword );
  
    $user = mysql_fetch_assoc( mysql_query($query) );
  
    mysql_close($conn);
*/              
?>